package com.personal.controller;


import com.personal.pojo.Result;
import com.personal.pojo.User;
import com.personal.server.UserServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class RegisterController {

    @Autowired
    private UserServer userServer;

    @RequestMapping("/register")
    public Result register(@RequestBody User user){
        boolean u = userServer.register(user);
        if(u){
            return Result.success("注册成功");
        }
        return Result.error("注册失败");
    }

}
